package com.example.study;

/**
 * VM args:-Xss2M
 * 
 * @author lli
 *
 * @version 1.0
 *
 */
public class JavaVMStackOOM {

    public static void main(String[] args) {
        JavaVMStackOOM a = new JavaVMStackOOM();
        a.stackLeak();
    }

    public void stackLeak() {

        while (true) {
            Thread a = new Thread(new Runnable() {
                
                @Override
                public void run() {
                   
                    while (true) {
                        
                    }
                }
            });
            a.start();
        }

    }
}
